package chat01;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;

public class Time {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("等待用户录入");
            String num = scanner.next();
            if (num.equals("N")) {
                break;
            } else {
                DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy年MM月dd日 hh:mm:ss");
                System.out.println(dateTimeFormatter.format(LocalDateTime.now()));
            }
        }
    }
}

